package com.yyge.controller.admin.mapstruct;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yyge.common.vo.resp.PageResp;
import com.yyge.controller.admin.addressbook.req.AddressBookReq;
import com.yyge.controller.admin.addressbook.resp.AddressBookResp;
import com.yyge.entity.AddressBook;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface AddressBookConverter {
    AddressBookConverter MAPPER = Mappers.getMapper(AddressBookConverter.class);

     @Mapping(source="records",target="rows")
     PageResp page2vo(Page list);

     AddressBook addressbook2req(AddressBookReq req);
     List<AddressBookResp> addressbook2resp(List<AddressBook> list);
}
